<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>

<c:choose>
	<c:when test="${empty item}">
		Item does not exist or you do not have rights to access it.
	</c:when>
	<c:otherwise>
		<div id="new-item-form">
		<form:form action="insert"  method="post" commandName="item">
		<form:label path="author"><fmt:message key="page.item.author.label" />:</form:label>
		<form:input path="author.value" />
		<form:errors path="author" cssClass="error" />
		<br />
		<form:label path="category"><fmt:message key="page.item.category.label" />:</form:label>
		<form:input path="category.value" />
		<form:errors path="category" cssClass="error" />
		<br />
		<form:label path="collection"><fmt:message key="page.item.collection.label" />:</form:label>
		<form:input path="collection.value" />
		<form:errors path="collection" cssClass="error" />
		<br />
		<form:label path="condition"><fmt:message key="page.item.condition.label" />:</form:label>
		<form:input path="condition.value" />
		<form:errors path="condition" cssClass="error" />
		<br />
		<form:label path="count"><fmt:message key="page.item.count.label" />:</form:label>
		<form:input path="count.value" />
		<form:errors path="count" cssClass="error" />
		<br />
		<form:label path="creationDate"><fmt:message key="page.item.creationDate.label" />:</form:label>
		<form:input path="creationDate.value" />
		<form:errors path="creationDate" cssClass="error" />
		<br />
		<form:label path="creationPlace"><fmt:message key="page.item.creationPlace.label" />:</form:label>
		<form:input path="creationPlace.value" />
		<form:errors path="creationPlace" cssClass="error" />
		<br />
		<form:label path="description"><fmt:message key="page.item.description.label" />:</form:label>
		<form:input path="description.value" />
		<form:errors path="description" cssClass="error" />
		<br />
		<form:label path="width"><fmt:message key="page.item.width.label" />:</form:label>
		<form:input path="width.value" />
		<form:errors path="width" cssClass="error" />
		<br />
		<form:label path="height"><fmt:message key="page.item.height.label" />:</form:label>
		<form:input path="height.value" />
		<form:errors path="height" cssClass="error" />
		<br />
		<form:label path="radius"><fmt:message key="page.item.radius.label" />:</form:label>
		<form:input path="radius.value" />
		<form:errors path="radius" cssClass="error" />
		<br />
		<form:label path="weight"><fmt:message key="page.item.weight.label" />:</form:label>
		<form:input path="weight.value" />
		<form:errors path="weight" cssClass="error" />
		<br />
		<form:label path="thickness"><fmt:message key="page.item.thickness.label" />:</form:label>
		<form:input path="thickness.value" />
		<form:errors path="thickness" cssClass="error" />
		<br />
		<form:label path="length"><fmt:message key="page.item.length.label" />:</form:label>
		<form:input path="length.value" />
		<form:errors path="length" cssClass="error" />
		<br />
		<form:label path="history"><fmt:message key="page.item.history.label" />:</form:label>
		<form:input path="history.value" />
		<form:errors path="history" cssClass="error" />
		<br />
		<form:label path="inventaryNumber"><fmt:message key="page.item.inventaryNumber.label" />:</form:label>
		<form:input path="inventaryNumber.value" />
		<form:errors path="inventaryNumber" cssClass="error" />
		<br />
		<form:label path="literature"><fmt:message key="page.item.literature.label" />:</form:label>
		<form:input path="literature.value" />
		<form:errors path="literature" cssClass="error" />
		<br />
		<form:label path="materialAndTechnique.technique"><fmt:message key="page.item.technique.label" />:</form:label>
		<form:input path="materialAndTechnique.technique" />
		<form:errors path="materialAndTechnique.technique" cssClass="error" />
		<br />
		<form:label path="materialAndTechnique.material"><fmt:message key="page.item.material.label" />:</form:label>
		<form:input path="materialAndTechnique.material" />
		<form:errors path="materialAndTechnique.material" cssClass="error" />
		<br />
		<form:label path="museum.country"><fmt:message key="page.item.country.label" />:</form:label>
		<form:input path="museum.country" />
		<form:errors path="museum.country" cssClass="error" />
		<br />
		<form:label path="museum.city"><fmt:message key="page.item.city.label" />:</form:label>
		<form:input path="museum.city" />
		<form:errors path="museum.city" cssClass="error" />
		<br />
		<form:label path="museum"><fmt:message key="page.item.museum.label" />:</form:label>
		<form:input path="museum.museum" />
		<form:errors path="museum" cssClass="error" />
		<br />
		<form:label path="negativeLabelAndNumber"><fmt:message key="page.item.negativeLabelAndNumber.label" />:</form:label>
		<form:input path="negativeLabelAndNumber.value" />
		<form:errors path="negativeLabelAndNumber" cssClass="error" />
		<br />
		<form:label path="numberInDocumentation"><fmt:message key="page.item.numberInDocumentation.label" />:</form:label>
		<form:input path="numberInDocumentation.value" />
		<form:errors path="numberInDocumentation" cssClass="error" />
		<br />
		<form:label path="numberInEntranceBook"><fmt:message key="page.item.numberInEntranceBook.label" />:</form:label>
		<form:input path="numberInEntranceBook.value" />
		<form:errors path="numberInEntranceBook" cssClass="error" />
		<br />
		<form:label path="photography"><fmt:message key="page.item.photography.label" />:</form:label>
		<form:input path="photography.value" />
		<form:errors path="photography" cssClass="error" />
		<br />
		<form:label path="price"><fmt:message key="page.item.price.label" />:</form:label>
		<form:input path="price.value" />
		<form:errors path="price" cssClass="error" />
		<br />
		<form:label path="procurementType"><fmt:message key="page.item.procurementType.label" />:</form:label>
		<form:input path="procurementType.value" />
		<form:errors path="procurementType" cssClass="error" />
		<br />
		<form:label path="remark"><fmt:message key="page.item.remark.label" />:</form:label>
		<form:input path="remark.value" />
		<form:errors path="remark" cssClass="error" />
		<br />
		<form:label path="repository"><fmt:message key="page.item.repository.label" />:</form:label>
		<form:input path="repository.value" />
		<form:errors path="repository" cssClass="error" />
		<br />
		<form:label path="restoration"><fmt:message key="page.item.restoration.label" />:</form:label>
		<form:input path="restoration.value" />
		<form:errors path="restoration" cssClass="error" />
		<br />
		<form:label path="stylePeriod"><fmt:message key="page.item.stylePeriod.label" />:</form:label>
		<form:input path="stylePeriod.value" />
		<form:errors path="stylePeriod" cssClass="error" />
		<br />
		<form:label path="subject"><fmt:message key="page.item.subject.label" />:</form:label>
		<form:input path="subject.value" />
		<form:errors path="subject" cssClass="error" />
		<br />
		<form:label path="subjectProcessedBy"><fmt:message key="page.item.subjectProcessedBy.label" />:</form:label>
		<form:input path="subjectProcessedBy.value" />
		<form:errors path="subjectProcessedBy" cssClass="error" />
		<br />
		<c:choose>
			<c:when test="${not empty newItem}">
				<input type="submit" value="Submit" />
				<input type="button" value="Cancel" onclick="javascript:window.location.href='catalogue'" />				
			</c:when>
		</c:choose>
	</form:form>
</div>
	</c:otherwise>
</c:choose>